package com.blockmeta.bbs.businesslibrary.umeng;

import android.animation.ObjectAnimator;
import android.view.View;

import com.blockmeta.bbs.baselibrary.utils.DimentionsUtil;

/**
 * Created by AirThor
 * Date 2018/5/7.
 */

public class AnimatorUtil {
    public static void bottomToTopAnim(View view,long duration){
        bottomToTopAnim(view,duration,true,0.8f);
    }
    public static void bottomToTopAnim(View view,long duration,float factor){
        bottomToTopAnim(view,duration,true,factor);
    }

    public static void bottomToTopAnim(View view,long duration,boolean isUseInterpolator,float factor){
        ObjectAnimator translationAnim= ObjectAnimator.ofFloat(view,"translationY", DimentionsUtil.dp2px(view.getContext(),120),0);
        translationAnim.setDuration(duration);
        if (isUseInterpolator) {
            translationAnim.setInterpolator(new SpringInterpolator(factor));
        }
        translationAnim.start();
    }
}
